//跳转函数 type：1navigate，2switchTab，3redirectTo， url为跳转地址
export function goNext(url, type = 1) {
	switch (type) {
		case 1:
			uni.navigateTo({
				url
			})
			break;
		case 1:
			uni.switchTab({
				url
			})
			break;
		case 3:
			uni.redirectTo({
				url
			})
			break;
	}
}

//后退函数
export function goBack(delta) {
	uni.navigateBack({
		delta
	})
}
// 获取h5链接参数
export function getURLParams() {
	var url = window.location.search;
	var theRequest = new Object();
	if (url.indexOf("?") != -1) {
		var str = url.substr(1);
		var strs = str.split("&");
		for (var i = 0; i < strs.length; i++) {
			theRequest[strs[i].split("=")[0]] = (strs[i].split("=")[1]);
		}
	}
	return theRequest
}
